<script setup lang="ts">
import { RouterView, useRouter } from 'vue-router'
import { ref } from 'vue'

const router = useRouter()
const activeMenu = ref('/')

function handleMenuSelect(key: string) {
  router.push(key)
}
</script>

<template>
  <div class="app-container">
    <el-menu
      :default-active="activeMenu"
      mode="horizontal"
      @select="handleMenuSelect"
      class="app-menu"
    >
      <el-menu-item index="/">
        <el-icon><Postcard /></el-icon>
        LOV使用演示
      </el-menu-item>
      <el-menu-item index="/cascade">
        <el-icon><Connection /></el-icon>
        LOV级联选择
      </el-menu-item>
      <el-menu-item index="/config">
        <el-icon><Setting /></el-icon>
        LOV配置管理
      </el-menu-item>
    </el-menu>

    <div class="app-content">
      <RouterView />
    </div>
  </div>
</template>

<style scoped>
.app-container {
  height: 100vh;
  background: #f0f2f5;
  width: 100vw;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-menu {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}
</style>
